package com.longxi.tianjintianbao.ui.activity.news;

import android.support.v7.widget.RecyclerView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.base.BaseActivity;
import com.longxi.tianjintianbao.ui.presenter.news.NewsAtPresenter;
import com.longxi.tianjintianbao.ui.view.news.INewsAtView;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;

public class NewsActivity extends BaseActivity<INewsAtView, NewsAtPresenter> implements INewsAtView {

    private String TAG = "NewsActivity";
    private String state = "";
    private int page = 0;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_general_refresh_list;
    }

    @Override
    public void initData() {
        super.initData();
        mPresenter.setBar();
        mPresenter.initAdapter();

    }

    @Override
    public void initListener() {
        super.initListener();
        mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
            @Override
            public void onRefresh(RefreshLayout refreshLayout) {
                mPresenter.newsBulletin();
            }
        });
        mRefreshLayout.autoRefresh();
    }

    @Override
    protected NewsAtPresenter createPresenter() {
        return new NewsAtPresenter(this);
    }

    @Override
    public SmartRefreshLayout getRefreshLayout() {
        return mRefreshLayout;
    }

    @Override
    public RecyclerView getRvContent() {
        return mRvContent;
    }

}
